//
//  MBProgressHUD+KR.m
//  cookBook
//
//  Created by kuroken on 16/1/31.
//  Copyright © 2016年 kuroken. All rights reserved.
//

#import "MBProgressHUD+KR.h"

@implementation MBProgressHUD (KR)
+ (MBProgressHUD *)showInView:(UIView *)view
{
    if (!view) {
        view = [[UIApplication sharedApplication].windows lastObject];
    }
    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
    [hud setActivityIndicatorColor:[UIColor grayColor]];
    [hud setColor:[UIColor clearColor]];
    return hud;
}

+ (MBProgressHUD *)showInView:(UIView *)view text:(NSString *)text
{
    if (!view) {
        view = [[UIApplication sharedApplication].windows lastObject];
    }
    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
    [hud setLabelText:text];
    [hud setColor:[UIColor lightGrayColor]];
    //    hud.labelColor = [UIColor whiteColor];
    //    hud.activityIndicatorColor = [UIColor yellowColor];
    [hud setDimBackground:YES];

    return hud;
}

+ (MBProgressHUD *)defaultHUD
{
    MBProgressHUD *hud = [[MBProgressHUD alloc] init];
    [hud setActivityIndicatorColor:[UIColor grayColor]];
    [hud setColor:[UIColor clearColor]];
    [hud show:YES];
    return hud;
}

+ (MBProgressHUD *)show
{
    return [MBProgressHUD showInView:nil];
}
@end
